package xq.demo.zip;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;

public class CmdLineUtil {
	public static List<String> exec(String cmdLine) {
		Process process = null;
		List<String> resultList = new ArrayList<String>();
		try {
			process = Runtime.getRuntime().exec(cmdLine);
			BufferedReader input = new BufferedReader(new InputStreamReader(
					process.getInputStream()));
			String line;
			while ((line = input.readLine()) != null) {
				resultList.add(line);
			}
			input.close();
		} catch (IOException e) {
			e.printStackTrace();
		}
		return resultList;
	}
}
